Truncate Table dbo.Star_BusinessUnit
go
Truncate Table dbo.Star_Company
go
Truncate Table dbo.Star_Cost
go
Truncate Table dbo.Star_Dates
go
Truncate Table dbo.Star_DatesPeriod
go
Truncate Table dbo.Star_Employee
go
Truncate Table dbo.Star_Employee_Tiers
go
Truncate Table dbo.Star_FiscalYear
go
Truncate Table dbo.Star_Item
go
Truncate Table dbo.Star_ItemBranch
go
Truncate Table dbo.Star_PaymentTerms
go
Truncate Table dbo.Star_Price
go
Truncate Table dbo.Star_Supplier
go
Truncate Table dbo.Star_UOMConversionFactors
go
Truncate Table dbo.TIER2
go

Truncate Table dbo.AR_Star_Customer
go

Truncate Table dbo.Sales_Star_Customer
go

Truncate Table dbo.Star_Account
go
Truncate Table dbo.Star_Account_Model
go
Truncate Table dbo.Star_AddressBook
go
USE [RD_COMMON]
GO

-- AR_Star_Customer

/****** Object:  Index [IX_AR_Star_BillToNumber]    Script Date: 08/20/2010 15:43:28 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[AR_Star_Customer]') AND name = N'IX_AR_Star_BillToNumber')
DROP INDEX [IX_AR_Star_BillToNumber] ON [dbo].[AR_Star_Customer] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_AR_Star_Customer_BillTo_Company]    Script Date: 08/20/2010 15:43:28 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[AR_Star_Customer]') AND name = N'IX_AR_Star_Customer_BillTo_Company')
DROP INDEX [IX_AR_Star_Customer_BillTo_Company] ON [dbo].[AR_Star_Customer] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_AR_Star_Customer_CustomerNumberID]    Script Date: 08/20/2010 15:43:28 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[AR_Star_Customer]') AND name = N'IX_AR_Star_Customer_CustomerNumberID')
DROP INDEX [IX_AR_Star_Customer_CustomerNumberID] ON [dbo].[AR_Star_Customer] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_AR_Star_CustomerNumber]    Script Date: 08/20/2010 15:43:28 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[AR_Star_Customer]') AND name = N'IX_AR_Star_CustomerNumber')
DROP INDEX [IX_AR_Star_CustomerNumber] ON [dbo].[AR_Star_Customer] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_AR_Star_ParentNumber]    Script Date: 08/20/2010 15:43:28 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[AR_Star_Customer]') AND name = N'IX_AR_Star_ParentNumber')
DROP INDEX [IX_AR_Star_ParentNumber] ON [dbo].[AR_Star_Customer] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [missing_index_175]    Script Date: 08/20/2010 15:43:28 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[AR_Star_Customer]') AND name = N'missing_index_175')
DROP INDEX [missing_index_175] ON [dbo].[AR_Star_Customer] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [missing_index_258]    Script Date: 08/20/2010 15:43:28 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[AR_Star_Customer]') AND name = N'missing_index_258')
DROP INDEX [missing_index_258] ON [dbo].[AR_Star_Customer] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [missing_index_260]    Script Date: 08/20/2010 15:43:28 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[AR_Star_Customer]') AND name = N'missing_index_260')
DROP INDEX [missing_index_260] ON [dbo].[AR_Star_Customer] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [missing_index_421]    Script Date: 08/20/2010 15:43:28 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[AR_Star_Customer]') AND name = N'missing_index_421')
DROP INDEX [missing_index_421] ON [dbo].[AR_Star_Customer] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [missing_index_423]    Script Date: 08/20/2010 15:43:28 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[AR_Star_Customer]') AND name = N'missing_index_423')
DROP INDEX [missing_index_423] ON [dbo].[AR_Star_Customer] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [missing_index_425]    Script Date: 08/20/2010 15:43:28 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[AR_Star_Customer]') AND name = N'missing_index_425')
DROP INDEX [missing_index_425] ON [dbo].[AR_Star_Customer] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [missing_index_427]    Script Date: 08/20/2010 15:43:28 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[AR_Star_Customer]') AND name = N'missing_index_427')
DROP INDEX [missing_index_427] ON [dbo].[AR_Star_Customer] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [missing_index_461]    Script Date: 08/20/2010 15:43:28 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[AR_Star_Customer]') AND name = N'missing_index_461')
DROP INDEX [missing_index_461] ON [dbo].[AR_Star_Customer] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [missing_index_469]    Script Date: 08/20/2010 15:43:28 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[AR_Star_Customer]') AND name = N'missing_index_469')
DROP INDEX [missing_index_469] ON [dbo].[AR_Star_Customer] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [PK_AR_Star_Customer]    Script Date: 08/20/2010 15:43:28 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[AR_Star_Customer]') AND name = N'PK_AR_Star_Customer')
ALTER TABLE [dbo].[AR_Star_Customer] DROP CONSTRAINT [PK_AR_Star_Customer]
GO


--[Sales_Star_Customer]

USE [RD_COMMON]
GO
BEGIN	
	{		
	/****** Object:  Index [IX_Sales_Star_CompanyNumber]    Script Date: 08/20/2010 15:43:42 ******/
	IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Customer]') AND name = N'IX_Sales_Star_CompanyNumber')
	DROP INDEX [IX_Sales_Star_CompanyNumber] ON [dbo].[Sales_Star_Customer] WITH ( ONLINE = OFF )
	GO

	/****** Object:  Index [IX_Sales_Star_Customer_CustomerNumberID]    Script Date: 08/20/2010 15:43:42 ******/
	IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Customer]') AND name = N'IX_Sales_Star_Customer_CustomerNumberID')
	DROP INDEX [IX_Sales_Star_Customer_CustomerNumberID] ON [dbo].[Sales_Star_Customer] WITH ( ONLINE = OFF )
	GO

	/****** Object:  Index [IX_Sales_Star_Customer_ShipToNumber]    Script Date: 08/20/2010 15:43:42 ******/
	IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Customer]') AND name = N'IX_Sales_Star_Customer_ShipToNumber')
	DROP INDEX [IX_Sales_Star_Customer_ShipToNumber] ON [dbo].[Sales_Star_Customer] WITH ( ONLINE = OFF )
	GO

	/****** Object:  Index [IX_Sales_Star_InvoiceToNumber]    Script Date: 08/20/2010 15:43:42 ******/
	IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Customer]') AND name = N'IX_Sales_Star_InvoiceToNumber')
	DROP INDEX [IX_Sales_Star_InvoiceToNumber] ON [dbo].[Sales_Star_Customer] WITH ( ONLINE = OFF )
	GO

	/****** Object:  Index [IX_Sales_Star_ParentNumber]    Script Date: 08/20/2010 15:43:42 ******/
	IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Customer]') AND name = N'IX_Sales_Star_ParentNumber')
	DROP INDEX [IX_Sales_Star_ParentNumber] ON [dbo].[Sales_Star_Customer] WITH ( ONLINE = OFF )
	GO

	/****** Object:  Index [IX_Sales_Star_ShipToNumber]    Script Date: 08/20/2010 15:43:42 ******/
	IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Customer]') AND name = N'IX_Sales_Star_ShipToNumber')
	DROP INDEX [IX_Sales_Star_ShipToNumber] ON [dbo].[Sales_Star_Customer] WITH ( ONLINE = OFF )
	GO

	/****** Object:  Index [IX_Sales_Star_SoldToNumber]    Script Date: 08/20/2010 15:43:42 ******/
	IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Customer]') AND name = N'IX_Sales_Star_SoldToNumber')
	DROP INDEX [IX_Sales_Star_SoldToNumber] ON [dbo].[Sales_Star_Customer] WITH ( ONLINE = OFF )
	GO

	/****** Object:  Index [missing_index_1]    Script Date: 08/20/2010 15:43:42 ******/
	IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Customer]') AND name = N'missing_index_1')
	DROP INDEX [missing_index_1] ON [dbo].[Sales_Star_Customer] WITH ( ONLINE = OFF )
	GO

	/****** Object:  Index [missing_index_101]    Script Date: 08/20/2010 15:43:42 ******/
	IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Customer]') AND name = N'missing_index_101')
	DROP INDEX [missing_index_101] ON [dbo].[Sales_Star_Customer] WITH ( ONLINE = OFF )
	GO

	/****** Object:  Index [missing_index_103]    Script Date: 08/20/2010 15:43:42 ******/
	IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Customer]') AND name = N'missing_index_103')
	DROP INDEX [missing_index_103] ON [dbo].[Sales_Star_Customer] WITH ( ONLINE = OFF )
	GO

	/****** Object:  Index [missing_index_105]    Script Date: 08/20/2010 15:43:42 ******/
	IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Customer]') AND name = N'missing_index_105')
	DROP INDEX [missing_index_105] ON [dbo].[Sales_Star_Customer] WITH ( ONLINE = OFF )
	GO

	/****** Object:  Index [missing_index_107]    Script Date: 08/20/2010 15:43:42 ******/
	IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Customer]') AND name = N'missing_index_107')
	DROP INDEX [missing_index_107] ON [dbo].[Sales_Star_Customer] WITH ( ONLINE = OFF )
	GO

	/****** Object:  Index [missing_index_109]    Script Date: 08/20/2010 15:43:42 ******/
	IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Customer]') AND name = N'missing_index_109')
	DROP INDEX [missing_index_109] ON [dbo].[Sales_Star_Customer] WITH ( ONLINE = OFF )
	GO

	/****** Object:  Index [missing_index_111]    Script Date: 08/20/2010 15:43:42 ******/
	IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Customer]') AND name = N'missing_index_111')
	DROP INDEX [missing_index_111] ON [dbo].[Sales_Star_Customer] WITH ( ONLINE = OFF )
	GO

	/****** Object:  Index [missing_index_115]    Script Date: 08/20/2010 15:43:42 ******/
	IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Customer]') AND name = N'missing_index_115')
	DROP INDEX [missing_index_115] ON [dbo].[Sales_Star_Customer] WITH ( ONLINE = OFF )
	GO

	/****** Object:  Index [missing_index_117]    Script Date: 08/20/2010 15:43:42 ******/
	IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Customer]') AND name = N'missing_index_117')
	DROP INDEX [missing_index_117] ON [dbo].[Sales_Star_Customer] WITH ( ONLINE = OFF )
	GO

	/****** Object:  Index [missing_index_121]    Script Date: 08/20/2010 15:43:42 ******/
	IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Customer]') AND name = N'missing_index_121')
	DROP INDEX [missing_index_121] ON [dbo].[Sales_Star_Customer] WITH ( ONLINE = OFF )
	GO

	/****** Object:  Index [missing_index_123]    Script Date: 08/20/2010 15:43:42 ******/
	IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Customer]') AND name = N'missing_index_123')
	DROP INDEX [missing_index_123] ON [dbo].[Sales_Star_Customer] WITH ( ONLINE = OFF )
	GO

	/****** Object:  Index [missing_index_125]    Script Date: 08/20/2010 15:43:42 ******/
	IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Customer]') AND name = N'missing_index_125')
	DROP INDEX [missing_index_125] ON [dbo].[Sales_Star_Customer] WITH ( ONLINE = OFF )
	GO

	/****** Object:  Index [missing_index_128]    Script Date: 08/20/2010 15:43:42 ******/
	IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Customer]') AND name = N'missing_index_128')
	DROP INDEX [missing_index_128] ON [dbo].[Sales_Star_Customer] WITH ( ONLINE = OFF )
	GO

	/****** Object:  Index [missing_index_144]    Script Date: 08/20/2010 15:43:42 ******/
	IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Customer]') AND name = N'missing_index_144')
	DROP INDEX [missing_index_144] ON [dbo].[Sales_Star_Customer] WITH ( ONLINE = OFF )
	GO

	/****** Object:  Index [missing_index_1465]    Script Date: 08/20/2010 15:43:42 ******/
	IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Customer]') AND name = N'missing_index_1465')
	DROP INDEX [missing_index_1465] ON [dbo].[Sales_Star_Customer] WITH ( ONLINE = OFF )
	GO

	/****** Object:  Index [missing_index_147]    Script Date: 08/20/2010 15:43:42 ******/
	IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Customer]') AND name = N'missing_index_147')
	DROP INDEX [missing_index_147] ON [dbo].[Sales_Star_Customer] WITH ( ONLINE = OFF )
	GO

	/****** Object:  Index [missing_index_1473]    Script Date: 08/20/2010 15:43:42 ******/
	IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Customer]') AND name = N'missing_index_1473')
	DROP INDEX [missing_index_1473] ON [dbo].[Sales_Star_Customer] WITH ( ONLINE = OFF )
	GO

	/****** Object:  Index [missing_index_152]    Script Date: 08/20/2010 15:43:42 ******/
	IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Customer]') AND name = N'missing_index_152')
	DROP INDEX [missing_index_152] ON [dbo].[Sales_Star_Customer] WITH ( ONLINE = OFF )
	GO

	/****** Object:  Index [missing_index_170]    Script Date: 08/20/2010 15:43:42 ******/
	IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Customer]') AND name = N'missing_index_170')
	DROP INDEX [missing_index_170] ON [dbo].[Sales_Star_Customer] WITH ( ONLINE = OFF )
	GO

	/****** Object:  Index [missing_index_177]    Script Date: 08/20/2010 15:43:42 ******/
	IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Customer]') AND name = N'missing_index_177')
	DROP INDEX [missing_index_177] ON [dbo].[Sales_Star_Customer] WITH ( ONLINE = OFF )
	GO

	/****** Object:  Index [missing_index_179]    Script Date: 08/20/2010 15:43:42 ******/
	IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Customer]') AND name = N'missing_index_179')
	DROP INDEX [missing_index_179] ON [dbo].[Sales_Star_Customer] WITH ( ONLINE = OFF )
	GO

	/****** Object:  Index [missing_index_180]    Script Date: 08/20/2010 15:43:42 ******/
	IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Customer]') AND name = N'missing_index_180')
	DROP INDEX [missing_index_180] ON [dbo].[Sales_Star_Customer] WITH ( ONLINE = OFF )
	GO

	/****** Object:  Index [missing_index_19]    Script Date: 08/20/2010 15:43:42 ******/
	IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Customer]') AND name = N'missing_index_19')
	DROP INDEX [missing_index_19] ON [dbo].[Sales_Star_Customer] WITH ( ONLINE = OFF )
	GO

	/****** Object:  Index [missing_index_202]    Script Date: 08/20/2010 15:43:42 ******/
	IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Customer]') AND name = N'missing_index_202')
	DROP INDEX [missing_index_202] ON [dbo].[Sales_Star_Customer] WITH ( ONLINE = OFF )
	GO

	/****** Object:  Index [missing_index_204]    Script Date: 08/20/2010 15:43:42 ******/
	IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Customer]') AND name = N'missing_index_204')
	DROP INDEX [missing_index_204] ON [dbo].[Sales_Star_Customer] WITH ( ONLINE = OFF )
	GO

	/****** Object:  Index [missing_index_206]    Script Date: 08/20/2010 15:43:42 ******/
	IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Customer]') AND name = N'missing_index_206')
	DROP INDEX [missing_index_206] ON [dbo].[Sales_Star_Customer] WITH ( ONLINE = OFF )
	GO

	/****** Object:  Index [missing_index_208]    Script Date: 08/20/2010 15:43:42 ******/
	IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Customer]') AND name = N'missing_index_208')
	DROP INDEX [missing_index_208] ON [dbo].[Sales_Star_Customer] WITH ( ONLINE = OFF )
	GO

	/****** Object:  Index [missing_index_212]    Script Date: 08/20/2010 15:43:42 ******/
	IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Customer]') AND name = N'missing_index_212')
	DROP INDEX [missing_index_212] ON [dbo].[Sales_Star_Customer] WITH ( ONLINE = OFF )
	GO

	/****** Object:  Index [missing_index_214]    Script Date: 08/20/2010 15:43:42 ******/
	IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Customer]') AND name = N'missing_index_214')
	DROP INDEX [missing_index_214] ON [dbo].[Sales_Star_Customer] WITH ( ONLINE = OFF )
	GO

	/****** Object:  Index [missing_index_216]    Script Date: 08/20/2010 15:43:42 ******/
	IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Customer]') AND name = N'missing_index_216')
	DROP INDEX [missing_index_216] ON [dbo].[Sales_Star_Customer] WITH ( ONLINE = OFF )
	GO

	/****** Object:  Index [missing_index_225]    Script Date: 08/20/2010 15:43:42 ******/
	IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Customer]') AND name = N'missing_index_225')
	DROP INDEX [missing_index_225] ON [dbo].[Sales_Star_Customer] WITH ( ONLINE = OFF )
	GO

	/****** Object:  Index [missing_index_242]    Script Date: 08/20/2010 15:43:42 ******/
	IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Customer]') AND name = N'missing_index_242')
	DROP INDEX [missing_index_242] ON [dbo].[Sales_Star_Customer] WITH ( ONLINE = OFF )
	GO

	/****** Object:  Index [missing_index_272]    Script Date: 08/20/2010 15:43:42 ******/
	IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Customer]') AND name = N'missing_index_272')
	DROP INDEX [missing_index_272] ON [dbo].[Sales_Star_Customer] WITH ( ONLINE = OFF )
	GO

	/****** Object:  Index [missing_index_276]    Script Date: 08/20/2010 15:43:42 ******/
	IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Customer]') AND name = N'missing_index_276')
	DROP INDEX [missing_index_276] ON [dbo].[Sales_Star_Customer] WITH ( ONLINE = OFF )
	GO

	/****** Object:  Index [missing_index_357]    Script Date: 08/20/2010 15:43:42 ******/
	IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Customer]') AND name = N'missing_index_357')
	DROP INDEX [missing_index_357] ON [dbo].[Sales_Star_Customer] WITH ( ONLINE = OFF )
	GO

	/****** Object:  Index [missing_index_6]    Script Date: 08/20/2010 15:43:42 ******/
	IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Customer]') AND name = N'missing_index_6')
	DROP INDEX [missing_index_6] ON [dbo].[Sales_Star_Customer] WITH ( ONLINE = OFF )
	GO

	/****** Object:  Index [missing_index_648]    Script Date: 08/20/2010 15:43:42 ******/
	IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Customer]') AND name = N'missing_index_648')
	DROP INDEX [missing_index_648] ON [dbo].[Sales_Star_Customer] WITH ( ONLINE = OFF )
	GO

	/****** Object:  Index [missing_index_652]    Script Date: 08/20/2010 15:43:42 ******/
	IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Customer]') AND name = N'missing_index_652')
	DROP INDEX [missing_index_652] ON [dbo].[Sales_Star_Customer] WITH ( ONLINE = OFF )
	GO

	/****** Object:  Index [missing_index_653]    Script Date: 08/20/2010 15:43:42 ******/
	IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Customer]') AND name = N'missing_index_653')
	DROP INDEX [missing_index_653] ON [dbo].[Sales_Star_Customer] WITH ( ONLINE = OFF )
	GO

	/****** Object:  Index [missing_index_7]    Script Date: 08/20/2010 15:43:42 ******/
	IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Customer]') AND name = N'missing_index_7')
	DROP INDEX [missing_index_7] ON [dbo].[Sales_Star_Customer] WITH ( ONLINE = OFF )
	GO

	/****** Object:  Index [missing_index_8]    Script Date: 08/20/2010 15:43:42 ******/
	IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Customer]') AND name = N'missing_index_8')
	DROP INDEX [missing_index_8] ON [dbo].[Sales_Star_Customer] WITH ( ONLINE = OFF )
	GO

	/****** Object:  Index [missing_index_83]    Script Date: 08/20/2010 15:43:42 ******/
	IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Customer]') AND name = N'missing_index_83')
	DROP INDEX [missing_index_83] ON [dbo].[Sales_Star_Customer] WITH ( ONLINE = OFF )
	GO

	/****** Object:  Index [missing_index_87]    Script Date: 08/20/2010 15:43:42 ******/
	IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Customer]') AND name = N'missing_index_87')
	DROP INDEX [missing_index_87] ON [dbo].[Sales_Star_Customer] WITH ( ONLINE = OFF )
	GO

	/****** Object:  Index [missing_index_908]    Script Date: 08/20/2010 15:43:42 ******/
	IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Customer]') AND name = N'missing_index_908')
	DROP INDEX [missing_index_908] ON [dbo].[Sales_Star_Customer] WITH ( ONLINE = OFF )
	GO

	/****** Object:  Index [PK_Sales_Star_Customer]    Script Date: 08/20/2010 15:43:42 ******/
	IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Customer]') AND name = N'PK_Sales_Star_Customer')
	ALTER TABLE [dbo].[Sales_Star_Customer] DROP CONSTRAINT [PK_Sales_Star_Customer]
	GO
}
ENd

USE [RD_COMMON]
GO

/****** Object:  Index [IX_Account_AIDID]    Script Date: 08/20/2010 15:43:55 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Star_Account]') AND name = N'IX_Account_AIDID')
DROP INDEX [IX_Account_AIDID] ON [dbo].[Star_Account] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_Account_BU]    Script Date: 08/20/2010 15:43:55 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Star_Account]') AND name = N'IX_Account_BU')
DROP INDEX [IX_Account_BU] ON [dbo].[Star_Account] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [missing_index_204]    Script Date: 08/20/2010 15:43:55 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Star_Account]') AND name = N'missing_index_204')
DROP INDEX [missing_index_204] ON [dbo].[Star_Account] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [missing_index_264]    Script Date: 08/20/2010 15:43:55 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Star_Account]') AND name = N'missing_index_264')
DROP INDEX [missing_index_264] ON [dbo].[Star_Account] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [missing_index_44]    Script Date: 08/20/2010 15:43:55 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Star_Account]') AND name = N'missing_index_44')
DROP INDEX [missing_index_44] ON [dbo].[Star_Account] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [missing_index_53]    Script Date: 08/20/2010 15:43:55 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Star_Account]') AND name = N'missing_index_53')
DROP INDEX [missing_index_53] ON [dbo].[Star_Account] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [missing_index_66]    Script Date: 08/20/2010 15:43:55 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Star_Account]') AND name = N'missing_index_66')
DROP INDEX [missing_index_66] ON [dbo].[Star_Account] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [missing_index_89]    Script Date: 08/20/2010 15:43:55 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Star_Account]') AND name = N'missing_index_89')
DROP INDEX [missing_index_89] ON [dbo].[Star_Account] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [PK_Star_Account]    Script Date: 08/20/2010 15:43:55 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Star_Account]') AND name = N'PK_Star_Account')
ALTER TABLE [dbo].[Star_Account] DROP CONSTRAINT [PK_Star_Account]
GO


USE [RD_COMMON]
GO

/****** Object:  Index [IX_BusinessUnit_BusinessUnitID]    Script Date: 08/20/2010 15:39:16 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Star_BusinessUnit]') AND name = N'IX_BusinessUnit_BusinessUnitID')
DROP INDEX [IX_BusinessUnit_BusinessUnitID] ON [dbo].[Star_BusinessUnit] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [missing_index_196]    Script Date: 08/20/2010 15:39:16 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Star_BusinessUnit]') AND name = N'missing_index_196')
DROP INDEX [missing_index_196] ON [dbo].[Star_BusinessUnit] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [missing_index_386]    Script Date: 08/20/2010 15:39:16 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Star_BusinessUnit]') AND name = N'missing_index_386')
DROP INDEX [missing_index_386] ON [dbo].[Star_BusinessUnit] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [missing_index_463]    Script Date: 08/20/2010 15:39:16 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Star_BusinessUnit]') AND name = N'missing_index_463')
DROP INDEX [missing_index_463] ON [dbo].[Star_BusinessUnit] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [PK_Star_BusinessUnit]    Script Date: 08/20/2010 15:39:16 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Star_BusinessUnit]') AND name = N'PK_Star_BusinessUnit')
ALTER TABLE [dbo].[Star_BusinessUnit] DROP CONSTRAINT [PK_Star_BusinessUnit]
GO


USE [RD_COMMON]
GO

/****** Object:  Index [IX_Cost_CostID]    Script Date: 08/20/2010 15:39:42 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Star_Cost]') AND name = N'IX_Cost_CostID')
DROP INDEX [IX_Cost_CostID] ON [dbo].[Star_Cost] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [missing_index_269]    Script Date: 08/20/2010 15:39:42 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Star_Cost]') AND name = N'missing_index_269')
DROP INDEX [missing_index_269] ON [dbo].[Star_Cost] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [PK_Star_Cost]    Script Date: 08/20/2010 15:39:42 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Star_Cost]') AND name = N'PK_Star_Cost')
ALTER TABLE [dbo].[Star_Cost] DROP CONSTRAINT [PK_Star_Cost]
GO

USE [RD_COMMON]
GO

/****** Object:  Index [IX_Dates]    Script Date: 08/20/2010 15:39:53 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Star_Dates]') AND name = N'IX_Dates')
DROP INDEX [IX_Dates] ON [dbo].[Star_Dates] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [missing_index_778]    Script Date: 08/20/2010 15:39:53 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Star_Dates]') AND name = N'missing_index_778')
DROP INDEX [missing_index_778] ON [dbo].[Star_Dates] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [PK_DATESPattern]    Script Date: 08/20/2010 15:39:53 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Star_Dates]') AND name = N'PK_DATESPattern')
ALTER TABLE [dbo].[Star_Dates] DROP CONSTRAINT [PK_DATESPattern]
GO


USE [RD_COMMON]
GO

/****** Object:  Index [IX_Item_ItemNumberID]    Script Date: 08/20/2010 15:40:19 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Star_Item]') AND name = N'IX_Item_ItemNumberID')
DROP INDEX [IX_Item_ItemNumberID] ON [dbo].[Star_Item] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [missing_index_119]    Script Date: 08/20/2010 15:40:19 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Star_Item]') AND name = N'missing_index_119')
DROP INDEX [missing_index_119] ON [dbo].[Star_Item] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [missing_index_172]    Script Date: 08/20/2010 15:40:19 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Star_Item]') AND name = N'missing_index_172')
DROP INDEX [missing_index_172] ON [dbo].[Star_Item] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [missing_index_433]    Script Date: 08/20/2010 15:40:19 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Star_Item]') AND name = N'missing_index_433')
DROP INDEX [missing_index_433] ON [dbo].[Star_Item] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [PK_Star_Item]    Script Date: 08/20/2010 15:40:19 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Star_Item]') AND name = N'PK_Star_Item')
ALTER TABLE [dbo].[Star_Item] DROP CONSTRAINT [PK_Star_Item]
GO

USE [RD_COMMON]
GO

/****** Object:  Index [IX_IB_Addressnumber]    Script Date: 08/20/2010 15:40:31 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Star_ItemBranch]') AND name = N'IX_IB_Addressnumber')
DROP INDEX [IX_IB_Addressnumber] ON [dbo].[Star_ItemBranch] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_ItemBranch_ItemBranchID]    Script Date: 08/20/2010 15:40:31 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Star_ItemBranch]') AND name = N'IX_ItemBranch_ItemBranchID')
DROP INDEX [IX_ItemBranch_ItemBranchID] ON [dbo].[Star_ItemBranch] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [missing_index_257]    Script Date: 08/20/2010 15:40:31 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Star_ItemBranch]') AND name = N'missing_index_257')
DROP INDEX [missing_index_257] ON [dbo].[Star_ItemBranch] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [missing_index_660]    Script Date: 08/20/2010 15:40:31 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Star_ItemBranch]') AND name = N'missing_index_660')
DROP INDEX [missing_index_660] ON [dbo].[Star_ItemBranch] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [PK_Star_ItemBranch]    Script Date: 08/20/2010 15:40:31 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Star_ItemBranch]') AND name = N'PK_Star_ItemBranch')
ALTER TABLE [dbo].[Star_ItemBranch] DROP CONSTRAINT [PK_Star_ItemBranch]
GO

USE [RD_COMMON]
GO

/****** Object:  Index [IX_SourceID_ParentNum]    Script Date: 08/20/2010 15:40:48 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Star_Supplier]') AND name = N'IX_SourceID_ParentNum')
DROP INDEX [IX_SourceID_ParentNum] ON [dbo].[Star_Supplier] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_Supplier_SupplierNumberID]    Script Date: 08/20/2010 15:40:48 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Star_Supplier]') AND name = N'IX_Supplier_SupplierNumberID')
DROP INDEX [IX_Supplier_SupplierNumberID] ON [dbo].[Star_Supplier] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [missing_index_422]    Script Date: 08/20/2010 15:40:48 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Star_Supplier]') AND name = N'missing_index_422')
DROP INDEX [missing_index_422] ON [dbo].[Star_Supplier] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [PK_Star_Supplier]    Script Date: 08/20/2010 15:40:48 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Star_Supplier]') AND name = N'PK_Star_Supplier')
ALTER TABLE [dbo].[Star_Supplier] DROP CONSTRAINT [PK_Star_Supplier]
GO

USE [RD_COMMON]
GO

/****** Object:  Index [missing_index_303]    Script Date: 08/20/2010 15:40:59 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Star_UOMConversionFactors]') AND name = N'missing_index_303')
DROP INDEX [missing_index_303] ON [dbo].[Star_UOMConversionFactors] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [missing_index_6]    Script Date: 08/20/2010 15:40:59 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Star_UOMConversionFactors]') AND name = N'missing_index_6')
DROP INDEX [missing_index_6] ON [dbo].[Star_UOMConversionFactors] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [PK_Star_UOMConversionFactors]    Script Date: 08/20/2010 15:40:59 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Star_UOMConversionFactors]') AND name = N'PK_Star_UOMConversionFactors')
ALTER TABLE [dbo].[Star_UOMConversionFactors] DROP CONSTRAINT [PK_Star_UOMConversionFactors]
GO

USE [RD_COMMON]
GO

/****** Object:  Index [missing_index_212]    Script Date: 08/20/2010 15:41:11 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[TIER2]') AND name = N'missing_index_212')
DROP INDEX [missing_index_212] ON [dbo].[TIER2] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [missing_index_216]    Script Date: 08/20/2010 15:41:11 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[TIER2]') AND name = N'missing_index_216')
DROP INDEX [missing_index_216] ON [dbo].[TIER2] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [missing_index_218]    Script Date: 08/20/2010 15:41:11 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[TIER2]') AND name = N'missing_index_218')
DROP INDEX [missing_index_218] ON [dbo].[TIER2] WITH ( ONLINE = OFF )
GO

